package cn.xopencode.userservice.convert;

import cn.xopencode.userservice.dal.mysql.dataobject.UserDO;
import cn.xopencode.userservice.rpc.user.dto.CreateUserDTO;
import cn.xopencode.userservice.rpc.user.dto.UpdateUserDTO;
import cn.xopencode.userservice.rpc.user.dto.UserDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;


/**
 * @Author xiaodawei
 * @since 2021/9/17
 */

@Mapper
public interface UserConvert {

    UserConvert INSTANCE = Mappers.getMapper(UserConvert.class);

    UserDTO convert(UserDO userDO);

    List<UserDTO> convert(List<UserDO> userDOList);

    UserDO convert(CreateUserDTO createUserDTO);

    UserDO convert(UpdateUserDTO updateUserDTO);
}
